<template>
  <el-card shadow="never">
    <el-tooltip class="item" content="新增资产类别" effect="dark" placement="top">
      <el-button
        size="small"
        v-if="$auth('assets:add')"
        class="fr mb10"
        type="primary"
        icon="el-icon-plus"
        @click="handleEdit(false, {})"
      />
    </el-tooltip>
    <classify-table @edit="handleEdit" ref="classifyTable" />
    <classify-modal @refresh="handleRefresh" ref="classifyModal" />
  </el-card>
</template>

<script>
import ClassifyTable from './ClassifyTable'
import ClassifyModal from './ClassifyModal'

export default {
  components: {
    ClassifyTable,
    ClassifyModal
  },
  methods: {
    handleEdit(bool, obj) {
      this.$refs.classifyModal.edit(bool, obj)
    },
    handleRefresh() {
      this.$refs.classifyTable.handleGetList()
    }
  }
}
</script>